package system.until;

import javax.servlet.http.HttpServletRequest;

import system.LoginContext;
import system.base.User;

import com.apep.crypt.CryptUtils;
import com.hitrust.gs.lib.GSAutoAuditongDateConfigurator;

public class EnterUntil {
	
	public static  String getEnterUrl(HttpServletRequest request) throws Exception{
		GSAutoAuditongDateConfigurator gs=GSAutoAuditongDateConfigurator.getInstance();
		String projectCode = gs.getProjectCode();
		LoginContext loginContext =  (LoginContext) request.getSession().getAttribute("LoginContext");
		String enterUrl = gs.getBackProjectManagerUrl();
		if(projectCode!=null&&loginContext!=null&&enterUrl!=null){
			String encrypt = "projectcode="+projectCode+"&usercode="+loginContext.getUser().getCode();
			return enterUrl+"?"+CryptUtils.encrypt(encrypt);
		}else{
			return "";
		}
	}
}
